import { expressjwt } from 'express-jwt';

export default function jwt() {
    const secret = process.env.TOKEN_SECRET;
    return expressjwt({ secret, algorithms: ['HS256'] }).unless({
        path: [
            // 不需要验证token的接口配置
            '/users/login',
            // '/dr',
            '/user/register'
        ]
    });
}